package jsimplesim.view.renderers;

import java.awt.*;
import javax.swing.*;
import org.apache.log4j.Logger;

/**
 * 
 * @author ALPHA
 */
public class StackCellRenderer extends StackColorCellRenderer {

	private static final long serialVersionUID = -7135460748931377164L;
	@SuppressWarnings("unused")
	private static int lastRowEdited;
	@SuppressWarnings("unused")
	private static int lastColEdited;
	static Logger logger = Logger.getLogger(StackCellRenderer.class);

	/**
     *
     */
	public StackCellRenderer() {

		setRequestFocusEnabled(false);
		setAlignmentX(Component.CENTER_ALIGNMENT);
		lastRowEdited = -1;
		lastColEdited = -1;

	}

	/**
	 * 
	 * @param row
	 * @param col
	 */
	public StackCellRenderer(int row, int col) {
		lastRowEdited = row;
		lastColEdited = col;
	}

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {

		super.getTableCellRendererComponent(table, value, isSelected, hasFocus,
				row, column);
		setBackground(setColor());
		setForeground(Color.white);
		setHorizontalAlignment(CENTER);

		return this;
	}
}
